<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SpringMVC</title>
</head>
<body>
  <h2>用户列表如下：</h2>
  <ul>
    <li>ID &nbsp;&nbsp;NICKNAME&nbsp;&nbsp;ACCOUNT&nbsp;&nbsp;ROLE</li>
    <c:forEach var="user" items="${users }">
      <li>${user.id }&nbsp;&nbsp;${user.nickname }&nbsp;&nbsp;${user.account }&nbsp;&nbsp;${user.role }</li>
    </c:forEach>
  </ul>
  <hr width="600px">
  <h2>添加用户</h2>
  <form action="/user/add" method="post">
    <table>
      <tr>
        <td>用户名</td>
        <td><input type="text" name="account"/></td>
      </tr>
      <tr>
        <td>密 码</td>
        <td><input type="password" name="password" /></td>
      </tr>
      <tr>
        <td>昵 称</td>
        <td><input type="text" name="nickname" /></td>
      </tr>
      <tr>
        <td>角 色</td>
        <td><select name="role"><option value="1">系统管理员</option>
            <option value="2">普通用户</option></select></td>
      </tr>
      <tr>
        <td colspan="2"><input type="submit" value="新增" /></td>
      </tr>
    </table>
  </form>
</body>
</html>